package com.zhz.mall.admin.config;

import com.aliyun.oss.OSSClient;
import com.zhz.mall.admin.properties.OssConfigProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


/**
 * @author zhouhengzhe
 */
@Configuration
public class OssConfig {
    @Autowired
    private OssConfigProperties ossConfigProperties;

    @Bean
    @SuppressWarnings("all")
    public OSSClient ossClient() {
        return new OSSClient(ossConfigProperties.getEndpoint(), ossConfigProperties.getAccessKeyId(), ossConfigProperties.getAccessKeySecret());
    }
}
